package BinarySortTree;

import jdk.jfr.SettingDefinition;

public class BinarySortTree {
    public static void main(String[] args){
        Node headNode=new Node(6);
        Setting method=new Setting(headNode);
        Node a=new Node(2);
        Node b=new Node(1);
        Node c=new Node(4);
        Node d=new Node(3);
        Node e=new Node(7);
        Node f=new Node(5);
        Node g=new Node(8);
        Node h=new Node(9);
        Node arr[]={a,b,c,d,e,f,g,h};
        for(int i=0;i<arr.length;i++){
            method.addNode(arr[i],method.headNode);
        }
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(1,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(2,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(3,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(4,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(5,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(6,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(7,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(8,method.headNode);
        method.midList(method.headNode);
        System.out.println();
        method.deleteNode(9,method.headNode);
        method.midList(method.headNode);
        System.out.println();
    }
}
